package com.cskaoyan.controller.admincontroller;

import com.cskaoyan.bean.po.MarketComment;
import com.cskaoyan.bean.common.BasePageInfo;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.service.adminservice.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dengqwe
 * @datetime 2022/12/30 14:01
 * @description: TODO:
 */
@RestController
@RequestMapping("admin/comment")
public class CommentController {
    @Autowired
    CommentService commentService;

    @RequestMapping("list")
    public BaseRespVo list(BasePageInfo info,String userId,String valueId) {
        CommonData<MarketComment> data = commentService.list(info,userId,valueId);
        return BaseRespVo.okYa(data);
    }

    @RequestMapping("delete")
    public BaseRespVo delete(@RequestBody MarketComment comment){
        commentService.delete(comment);
        return BaseRespVo.ok();
    }
}
